//
//  CanEditViewCell.m
//  HeZhong
//
//  Created by 姚冬元 on 16/4/13.
//  Copyright © 2016年 SwiftHorse. All rights reserved.
//

#import "CanEditViewCell.h"
#import "UIImage+Extension.h"

@implementation CanEditViewCell

- (UIImageView *)rightArrow
{
    if (_rightArrow == nil) {
        self.rightArrow = [[UIImageView alloc] initWithImage:[UIImage imageWithName:@"common_icon_arrow"]];
    }
    return _rightArrow;
}

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self initUI];
    }
    return self;
}

- (void)initUI
{
    CGFloat fontSize = iphone6p ? 15 : 14;
    
    self.accessoryView = self.rightArrow;
    
    _textLab = [[UILabel alloc] init];
    _textLab.textAlignment = NSTextAlignmentLeft;
    _textLab.textColor = FontColor;
    _textLab.font = LPFont(fontSize);
    [self addSubview:_textLab];
    
    _contentLab = [[UILabel alloc] init];
    _contentLab.textAlignment = NSTextAlignmentRight;
    _contentLab.textColor = Color(166, 166, 166);
    _contentLab.font = LPFont(fontSize);
    [self addSubview:_contentLab];
    
    [_textLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(20);
        make.centerY.mas_equalTo(self.mas_centerY);
        make.height.mas_equalTo(@30);
        make.width.mas_equalTo(@100);
    }];
    
    [_contentLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.mas_equalTo(@40);
        make.width.mas_equalTo(@110);
        make.right.offset(-40);
        make.centerY.mas_equalTo(self.mas_centerY);
    }];
}

@end
